<?php

include_once "xAP-functions/webincludes.php";
$id=intval($_GET["id"]);
$url="http://www.bbc.co.uk/cgi-perl/weather/search/new_search.pl";
echo webpageheader();

$sql="select * from xAP_Weather_Source where SourceID=".$id;
$results=dbquery($sql);
$row=$results[0];
if($row["Source"]=="BBC"){
	
	if (intval($row["SourceRef"])>0){
		$url="http://www.bbc.co.uk/weather/5day.shtml?".$row["SourceType"]."=".$row["SourceRef"];
	}
}

//display

?>

<form name='settings' method='POST' action='config_setup_update.php'>
<input type='hidden' name='id' value='<?=$id?>'>
<table width=100%>
<TR><TD class='boldtext'>Feed</td><TD class='boldtext' colspan=3><?=$row["Location"]?></td></tr>
<TR><TD class='boldtext'>New Location</td><TD class='boldtext' colspan=3>
<img src='../images/rss.gif'><input id='url' size=60 name='url' value=''></td></tr>
<TR><TD class='boldtext'>Delete</td><TD class='boldtext' colspan=3><input type='checkbox' name='delete' value='1'></td></tr>
<TR><TD class='boldtext'></td><TD class='boldtext' colspan=3><input type='submit' value='Update'></td></tr>
<TR><TD class='normalsmalltext' colspan=4>Navigate using the window below to the weather feed you want. Once found drag the 'Latest observation feed' RSS link to the New Location box above, and click update.</TD></TR>
</table>

<center>
	<iframe id='iframe' name='iframe' width=800 height=500 src="<?=$url?>">
	</iframe>
	</center>
</form>

<?php
echo webpagefooter();
?>